﻿using System;
using System.ComponentModel;
using System.Windows.Forms;

namespace UtfprLibrary.Windows.Forms.ComponentModel {
    /// <summary>
    /// TODO
    /// </summary>
    internal class InitialControlInFocusConverter : ReferenceConverter {
        /// <summary>
        /// TODO
        /// </summary>
        /// <param name="type"></param>
        public InitialControlInFocusConverter(Type type) : base(type) { }

        /// <summary>
        /// TODO
        /// </summary>
        /// <param name="context"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        protected override bool IsValueAllowed(ITypeDescriptorContext context, object value) {
            return ((value is TextBox) || (value is ListBox) || (value is ComboBox) || (value is UserControl));
        }
    }
}
